//
//  YJViewController.m
//  SugarPile
//
//  Created by LC on 16/3/1.
//  Copyright © 2016年 www.lanou39.蓝鸥科技. All rights reserved.
//

#import "YJViewController.h"

@interface YJViewController ()
@property (nonatomic, retain)UIWebView *webView;
@end

@implementation YJViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(huiqu:)];
    [self tel3];
}
- (void)tel3
{
    // 提示：不要将webView添加到self.view，如果添加会遮挡原有的视图
    // 懒加载
    if (_webView == nil) {
        _webView = [[UIWebView alloc] init];
    }
    NSLog(@"%p", _webView);
    
    //    _webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    //    [self.view addSubview:_webView];
    
    NSURL *url = [NSURL URLWithString:@"tel://10086"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    
    [_webView loadRequest:request];
}
- (void)huiqu:(UINavigationBar *)btn
{
    [self dismissViewControllerAnimated:YES completion:^{
        NSLog(@"回去");
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end